﻿<UserControl x:Class="XWord.GUI.Views.Words.BaseWordExplainView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:XWord.GUI.Views.Words"
             xmlns:info="http://schemas.xword.com/winfx/xaml/info"
             xmlns:cal="http://www.caliburnproject.org"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">

    <Expander IsExpanded="True">
        <Expander.Header>
                <TextBlock Text="{Binding DataContext.DisplayName,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type local:BaseWordExplainView}}}"/>
        </Expander.Header>
        <StackPanel>
            <StackPanel Orientation="Horizontal">
                <FlowDocumentScrollViewer VerticalScrollBarVisibility="Disabled" HorizontalAlignment="Left" MaxWidth="150">
                    <FlowDocument LineHeight="1" FontSize="12">
                        <Paragraph>
                            <Run info:FlowDocumentService.RunText="{Binding SelectedItem.Name}" FontWeight="Bold" />
                            <Run info:FlowDocumentService.RunText="{Binding SelectedItem.Pron,StringFormat={}[{0}]}" Foreground="#FF009900" />
                        </Paragraph>
                    </FlowDocument>
                </FlowDocumentScrollViewer>
                <Button Content="发音"
                                    cal:Message.Attach="[Event Click] = [Action ReadSelectedWord($DataContext.Name)]">
                    <!--<ribbon:Menu>
                        <Button Content="导出今日单词" cal:Message.Attach="ExportTodayWordList"/>
                        <Button Content="导入今日单词" cal:Message.Attach="ImportTodayWordList"/>
                        <Button Content="真人发音" cal:Message.Attach="ExportSelectedWordList(Element_WordList.SelectedItems:OneWay)"/>
                    </ribbon:Menu>-->
                </Button>
            </StackPanel>
            
            <FlowDocumentScrollViewer VerticalScrollBarVisibility="Disabled">
                <FlowDocument LineHeight="1" FontSize="12">
                    <Paragraph>
                        <Run info:FlowDocumentService.RunText="{Binding SelectedItem.Comment}"></Run>
                    </Paragraph>
                </FlowDocument>
            </FlowDocumentScrollViewer>
           
        </StackPanel>
    </Expander>
</UserControl>
